import Vue from 'vue';
//配置路由
import VueRouter from 'vue-router'
Vue.use(VueRouter);
//1.创建组件
import Index from '@/views/index'
import Home from '@/views/home'
import Login from '@/views/login'
import NotFound from '@/views/404'
import UpdatePassword from '@/views/update-password'
import pay from '@/views/pay'
import register from '@/views/register'
import center from '@/views/center'
import adminexam from '@/views/modules/exampaperlist/exam'
import jiangshikebiao from '@/views/modules/jiaoshikebiao/list'
import kechengxinxi from '@/views/modules/jiaoshikebiao/kechengxinxi'
import jiaoshikebiao from '@/views/modules/jiaoshikebiao/jiaoshikebiao'
import kechengjibenbiao from '@/views/modules/jiaoshikebiao/kechengjibenbiao'
import examfailrecord from '@/views/modules/examfailrecord/list'
import jiangshipingjiao from '@/views/modules/jiangshipingjiao/list'
import examquestion from '@/views/modules/examquestion/list'
import xueshengkebiao from '@/views/modules/xueshengkebiao/list'
import xueyuangkebiao from '@/views/modules/xueshengkebiao/xueyuankebiao'
import xueyuan from '@/views/modules/xueyuan/list'
import xueyuanchengji from '@/views/modules/xueyuanchengji/list'
import exampaper from '@/views/modules/exampaper/list'
import xueyuanpingjiao from '@/views/modules/xueyuanpingjiao/list'
import jiangshi from '@/views/modules/jiangshi/list'
import exampaperlist from '@/views/modules/exampaperlist/list'
import xuexiziliao from '@/views/modules/xuexiziliao/list'
import gonggaoxinxi from '@/views/modules/gonggaoxinxi/list'
import jiuyezhongxin from '@/views/modules/jiuyezhongxin/list'
import examrecord from '@/views/modules/examrecord/list'


//2.配置路由   注意：名字
const routes = [{
  path: '/index',
  name: '首页',
  component: Index,
  children: [{
    // 这里不设置值，是把main作为默认页面
    path: '/',
    name: '首页',
    component: Home,
    meta: { icon: '', title: 'center' }
  }, {
    path: '/updatePassword',
    name: '修改密码',
    component: UpdatePassword,
    meta: { icon: '', title: 'updatePassword' }
  }, {
    path: '/pay',
    name: '支付',
    component: pay,
    meta: { icon: '', title: 'pay' }
  }, {
    path: '/center',
    name: '个人信息',
    component: center,
    meta: { icon: '', title: 'center' }
  }
    , {
    path: '/jiangshikebiao',
    name: '讲师课表',
    component: jiangshikebiao
  } , {
    path: '/jiaoshikebiao',
    name: '教师课表',
    component: jiaoshikebiao
  }, {
    path: '/kechengxinxi',
    name: '课程信息',
    component: kechengxinxi
  }
    , {
    path: '/examfailrecord',
    name: '错题本',
    component: examfailrecord
  }
    , {
    path: '/jiangshipingjiao',
    name: '讲师评教',
    component: jiangshipingjiao
  }
    , {
    path: '/examquestion',
    name: '试题管理',
    component: examquestion
  }
    , {
    path: '/xueshengkebiao',
    name: '学生课表',
    component: xueshengkebiao
  }
    , {
    path: '/xueyuan',
    name: '学员',
    component: xueyuan
  }
    , {
    path: '/xueyuanchengji',
    name: '学员成绩',
    component: xueyuanchengji
  }
    , {
    path: '/exampaper',
    name: '课后测试管理',
    component: exampaper
  }
    , {
    path: '/xueyuanpingjiao',
    name: '学员评价',
    component: xueyuanpingjiao
  }
    , {
    path: '/jiangshi',
    name: '讲师',
    component: jiangshi
  }
    , {
    path: '/exampaperlist',
    name: '课后测试列表',
    component: exampaperlist
  }
    , {
    path: '/xuexiziliao',
    name: '学习资料',
    component: xuexiziliao
  }
    , {
    path: '/gonggaoxinxi',
    name: '公告信息',
    component: gonggaoxinxi
  }
    , {
    path: '/jiuyezhongxin',
    name: '就业中心',
    component: jiuyezhongxin
  }
    , {
    path: '/examrecord',
    name: '测试记录',
    component: examrecord
  }, {
    path: '/kechengjibenbiao',
    name: '课程基本表',
    component: kechengjibenbiao
  }, {
    path: '/xueyuangkebiao',
    name: '学员课表',
    component: xueyuangkebiao
  }
  ]
},
{
  path: '/adminexam',
  name: 'adminexam',
  component: adminexam,
  meta: { icon: '', title: 'adminexam' }
},
{
  path: '/login',
  name: 'login',
  component: Login,
  meta: { icon: '', title: 'login' }
},
{
  path: '/register',
  name: 'register',
  component: register,
  meta: { icon: '', title: 'register' }
},
{
  path: '/',
  name: '首页',
  redirect: '/index'
}, /*默认跳转路由*/
{
  path: '*',
  component: NotFound
}
]
//3.实例化VueRouter  注意：名字
const router = new VueRouter({
  mode: 'hash',
  /*hash模式改为history*/
  routes // （缩写）相当于 routes: routes
})

export default router;
